home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 41
/
Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso
/
-seriously_amiga-
/
graphics
/
picsize
/
picsize.readme
< prev
next >
Wrap
Text File
|
1999-04-19
|
5KB
|
169 lines
Short: Shows picture dimensions using datatypes
Kurz: Zeigt Bildausmaße anhand Datatypes
Author: raresoft@rz.fh-augsburg.de (Ralph Reuchlein)
Uploader: raresoft@rz.fh-augsburg.de (Ralph Reuchlein)
Type: util/dtype
Version: 1.0
PicSize
=======
PURPOSE
The archive contains a small program to determine picture
dimensions including the sources.
Since I am working alot with images that were downloaded from
Aminet or other internet sources, were made by myself or were
generated by software, sometimes its useful to list image
dimensions instead of showing them or using other image viewers
with verbose output.
This picture dimension determiner is based on the datatypes system
which is available since OS 3.0. Therefore you can scan each image
which datatype you have installed on your system.
The sources is only one C source :-) This file should be compatible
to each compiler and contains features like Templates and
ReadArgs(), functions with variable arguments and -of course- the
simple datatype handling.
INSTALL
Simply unpack the archive to anywhere you want.
REQUIREMENTS
- OS 3.0
- datatypes for your image types
USAGE
The template is
PICTURE=PIC/A,WIDTH/S,HEIGHT/S,SIZE/S,DEPTH/S,FORMAT/S,FULL/S
You always have to provide the image file you want to determine.
Without any of the switches (each template with '/S') you will get
the full information about the image:
> picsize scully03.jpg
scully03.jpg 522x317x24, JFIF
Column 1 displays the filename (without path), then the image
dimension with width, height and depth is shown and finally the
internal base name of the datatype is displayed.
The same output is done with option FULL.
The other switches can only be used standalone except WIDTH and
HEIGHT. If you only use the switch DEPTH, picsize will only output
> picsize scully03.jpg DEPTH
24
The same functionality is used for the other switches, too.
There's only one exception: You can use WIDTH and HEIGHT together
for a output like this:
> picsize scully03.jpg WIDTH HEIGHT
522x317
The main purpose of picsize is scripting. For example you can use
the script s:SPAT for a simple picture list:
s:SPAT picsize IMAGES:xfiles/scully#?
which prints:
> s:spat picsize IMAGES:xfiles/scully#?
scully03.jpg 522x317x24, JFIF
scully02.jpg 476x328x24, JFIF
scully01.jpg 476x365x24, JFIF
Another example includes the command substitution feature of
CLI/Shell:
> rename scully02.jpg as scully02_`picsize scully02.jpg WIDTH HEIGHT`.jpg
This one would rename the file "scully02.jpg" as
"scully02_476x328.jpg".
BUGS
Unfortunately there is a bug, but don't blame me for that, because
the error lies in the datatypes.
The picture datatypes like ilbm.datatype or jfif.datatype first
unpack the image to CHIP RAM, then they build up a BitMap structure
and finally a BitMapHeader structure. The BitMapHeader structure
holds the information like width, height, depth and so on. If you
now try to open a huge image which bitmap can't be build in CHIP
MEM due to insufficient memory, picsize returns an error. Now the
bug strikes back: You might detect that the datatype system
grabbed a huge portion of CHIP RAM and the datatype forgot to free
it! You have no chance to free that unused memory; the only thing
is a reboot.
But ...
Good news for CyberGraphX V3 users: CGFX has a environment variable
PLANES2FAST which allowes swapping unused bitmaps to FAST RAM. If
the variable is set to 1, the datatype system builds the bitmaps in
FAST RAM. If you have 64 MB RAM, you can determine very huge images
without having a memory bug as described above. The variable
unfortunately has some negative side effects: Each program assuming
a bitmap in CHIP RAM would access on a non-allocated area in CHIP
RAM (remember, the bitmap is swapped to FAST RAM!) that surely
leads to system crashes.
DISCLAIMER
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
MISC
Suggestions and bug reports are welcome, but I think the little
program's purpose is fully accomplished.
CONTACT
snail Ralph Reuchlein
mail: Eibseestr. 18c
86163 Augsburg
GERMANY
eMail: raresoft@rz.fh-augsburg.de (until July 1999)
WWW: rr.home.pages.de
IRC: RRipley on #germany